package com.hns.can.report.web;

import com.hns.can.common.domain.GridPage;
import com.hns.can.common.web.BaseController;
import com.hns.can.master.vo.LeftOrgVo;
import com.hns.can.report.entity.TBsStatDayDataTargetEntity;
import com.hns.can.report.service.QualityIndexService;
import com.hns.can.report.vo.QualityIndexParamVo;
import com.hns.can.report.vo.QualityIndexVo;
import com.hns.frame.mybatis.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 质量指标控制类
 *
 * @author:zhangzq
 * @email:
 * @version Revision 2.0.0
 */
@Controller
@RequestMapping("/qualityIndex")
public class QualityIndexController extends BaseController {
    @Autowired
    private QualityIndexService qualityIndexService;

    /**
     * 查询车辆信息
     *
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
    @RequestMapping("/getCarInfoList")
    @ResponseBody
    public Object getCarInfoList() throws Exception {
        List<LeftOrgVo> list = qualityIndexService.getCarInfoList();
        return this.getReturnResult(list);
    }

    @RequestMapping("/getLineInfoList")
    @ResponseBody
    public Object getLineInfoList()throws Exception {
    	List<LeftOrgVo> list = qualityIndexService.getLineInfoList();
    	return this.getReturnResult(list);
    }
    
    
    /**
     * 分页查询数据质量指标日报
     *
     * @param vo
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
    @RequestMapping("/searchQualityIndexPage")
    @ResponseBody
    public Object searchQualityIndexPage(QualityIndexParamVo vo ) throws Exception {
        Pagination page = qualityIndexService.searchQualityIndexPage(vo);
        GridPage grid = new GridPage(page);
        return this.getReturnResult(grid);
    }

    /**
     * 查询数据质量指标日报
     *
     * @param vo
     * @return
     * @throws Exception
     * @author:zhangzq
     * @email:
     */
    @RequestMapping("/searchQualityIndexList")
    @ResponseBody
    public Object searchQualityIndexList(QualityIndexParamVo vo ) throws Exception {
        List<QualityIndexVo> list = qualityIndexService.searchQualityIndexList(vo);
        return this.getReturnResult(list);
    }

    /**
     * 车辆数据质量
     * @param vo
     * @return
     * @throws Exception
     */
    @RequestMapping("/getdataQualityPage")
    @ResponseBody
    public Object getdataQualityPage(QualityIndexParamVo vo) throws Exception{
        Pagination page = qualityIndexService.getdataQualityPage(vo);
        GridPage grid = new GridPage(page);
        return this.getReturnResult(grid);
    }
}
